cc.Class({
    extends: cc.Component,

    ctor: function () {
		
		this.defaultType = 9;
		
		this.config = [
			
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:8}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:5}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			     {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9},
			{t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}, {t:9,s:9}
		]
		
		//w 3 -> 5 3 , h 6 -> 16 11 , s 3 -> 6 3
		this.levelConfig = [
			
			//0-6
			{width:3,height:6,shape:3,target:200,step:3,maptype:0},
			{width:3,height:6,shape:3,target:500,step:3,maptype:1},
			{width:3,height:7,shape:3,target:800,step:3,maptype:0},
			{width:3,height:7,shape:4,target:1200,step:4,maptype:1,items:[{no:0,type1:7,type2:1}]},
			{width:3,height:8,shape:4,target:1700,step:4,maptype:0,items:[{no:1,type1:7,type2:1}]},
			{width:3,height:8,shape:4,target:2300,step:4,maptype:1,items:[{no:2,type1:7,type2:1}]},
			{width:4,height:8,shape:4,target:3000,step:4,maptype:0,items:[{no:1,type1:7,type2:1}]},
			
			//7-13
			{width:4,height:8,shape:5,target:3800,step:5,maptype:1,items:[{no:2,type1:7,type2:1}]},
			{width:4,height:9,shape:5,target:4700,step:5,maptype:0,items:[{no:1,type1:7,type2:1}]},
			{width:4,height:9,shape:5,target:5700,step:5,maptype:1,items:[{no:2,type1:7,type2:1}]},
			{width:4,height:10,shape:5,target:6800,step:5,maptype:0,items:[{no:1,type1:7,type2:1}]},
			{width:4,height:10,shape:5,target:8000,step:5,maptype:1,items:[{no:2,type1:7,type2:1}]},
			{width:4,height:11,shape:6,target:9300,step:6,maptype:0,items:[{no:1,type1:7,type2:1}]},
			{width:4,height:11,shape:6,target:10700,step:6,maptype:1,items:[{no:2,type1:7,type2:1}]},
			
			
			//14-20
			{width:4,height:12,shape:6,target:12200,step:6,maptype:0,items:[{no:1,type1:7,type2:1},{no:2,type1:7,type2:1}]},
			{width:4,height:12,shape:6,target:13800,step:6,maptype:1,items:[{no:2,type1:7,type2:1},{no:0,type1:7,type2:1}]},
			{width:5,height:12,shape:6,target:15500,step:6,maptype:0,items:[{no:1,type1:7,type2:1},{no:0,type1:7,type2:1}]},
			{width:5,height:12,shape:6,target:17300,step:6,maptype:1,items:[{no:2,type1:7,type2:1},{no:3,type1:7,type2:1}]},
			{width:5,height:13,shape:7,target:19200,step:7,maptype:0,items:[{no:1,type1:7,type2:1},{no:2,type1:7,type2:1}]},
			{width:5,height:13,shape:7,target:21200,step:7,maptype:1,items:[{no:3,type1:7,type2:1},{no:0,type1:7,type2:1}]},
			{width:5,height:14,shape:7,target:23300,step:7,maptype:0,items:[{no:1,type1:7,type2:1},{no:3,type1:7,type2:1}]},
			
			//21-25
			{width:5,height:14,shape:7,target:25500,step:7,maptype:1,items:[{no:0,type1:7,type2:1},{no:1,type1:7,type2:1},{no:2,type1:7,type2:1}]},
			{width:5,height:15,shape:7,target:27800,step:7,maptype:0,items:[{no:3,type1:7,type2:1},{no:1,type1:7,type2:1},{no:2,type1:7,type2:1}]},
			{width:5,height:15,shape:7,target:29200,step:7,maptype:1,items:[{no:0,type1:7,type2:1},{no:1,type1:7,type2:1},{no:3,type1:7,type2:1}]},
			{width:5,height:16,shape:7,target:31700,step:7,maptype:0,items:[{no:0,type1:7,type2:1},{no:3,type1:7,type2:1},{no:2,type1:7,type2:1}]},
			{width:5,height:16,shape:7,target:35000,step:7,maptype:1,items:[{no:0,type1:7,type2:1},{no:1,type1:7,type2:1},{no:2,type1:7,type2:1}]},

		]
		
		//w 3 -> 5 3 , h 6 -> 16 11 , s 3 -> 6 3
		
		if(CC_WECHATGAME){
			
			this.chapterConfig = cc.sys.localStorage.getItem("CHAPTERCONFIG");
			
		}else{
		
		this.chapterConfig = [
			
			//0-6
			
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			
			
			{width:4,height:10,step:20,target:12,maptype:0,targetType1:10,targetType2:2,empty:{"0":1,"3":1,"28":1,"31":1},
				ice:{"8":1,"9":1,"11":1,"12":1,"13":1,"15":1,"16":1,"18":1,"19":1,"20":1,"22":1,"23":1,}
			},
			
			{width:4,height:11,step:20,target:1,maptype:0,targetType1:7,targetType2:0,empty:{"0":1,"3":1,"32":1,"28":1,"31":1,"34":1}
			,items:[{no:4,type1:7,type2:0}]},
			
			{width:4,height:12,step:20,target:3,maptype:0,targetType1:-1,targetType2:5},
			
			{width:4,height:10,step:20,target:28,maptype:0,targetType1:10,targetType2:2,empty:{"0":1,"3":1,"28":1,"31":1},
				ice:{
					"8":1,"9":1,"11":1,"12":1,"13":1,"15":1,"16":1,"18":1,"19":1,"20":1,"22":1,"23":1,
					"1":1,"2":1,"4":1,"5":1,"6":1,"7":1,"10":1,"17":1,"14":1,"21":1,"24":1,"25":1,"26":1,"27":1,"29":1,"30":1,
				}
			},
			
			{width:4,height:14,step:20,target:1,maptype:0,targetType1:7,targetType2:0
			,empty:{"4":1,"11":1,"18":1,"25":1,"32":1,"39":1,"46":1}
			,items:[{no:0,type1:7,type2:0}]},
			
			{width:4,height:12,step:25,target:5,maptype:0,targetType1:-1,targetType2:7},
			
			{width:5,height:16,step:25,target:68,maptype:0,targetType1:10,targetType2:7,
			ice:{
					"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,
					"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,
					"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,
					"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"39":1,"40":1,
					"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,
					"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1,"60":1,
					"61":1,"62":1,"63":1,"64":1,"65":1,"66":1,"67":1
				}
			},
			
			{width:4,height:11,step:25,target:2,maptype:0,targetType1:7,targetType2:0,empty:{"0":1,"3":1,"32":1,"28":1,"31":1,"34":1}
			,items:[{no:4,type1:7,type2:0},{no:6,type1:7,type2:0}]},
			
			
			{width:4,height:12,step:25,target:3,maptype:0,targetType1:1,targetType2:8
			,empty:{"18":1,"19":1,"20":1}
			,create:{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1}
			},
			
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},
			{width:4,height:10,step:20,target:20,maptype:0,targetType1:0,targetType2:1,empty:{"0":1,"3":1,"28":1,"31":1}},

			]
		}
		
	}
});
